package string01

// ~用于字符串,会创建Pattern对象,用于正则模式,或者直接使用/
obj = ~"hello"
println obj.getClass().name //java.util.regex.Pattern
//部分匹配 =~
re = ~"groovy*"
text="groovy is very good"
if(text =~ re){
    println "match"
}else{
    println "no macth"
}
//精确匹配 ==~
rem= /groovy is very good/
if(text ==~ rem){
    println "match"
}else{
    println "no macth"
}